//
//  NSObject+ObjUtil.m
//  fitnessmanage
//
//  Created by wujian on 2018/1/11.
//  Copyright © 2018年 zongquankeji. All rights reserved.
//

#import "NSObject+ObjUtil.h"

@implementation NSObject (ObjUtil)

-(NSString *)formatTime{
    
    if ([self isEqual:[NSNull null]]) {
        
        return @"";
    }
    
     NSString *str = (NSString *)self;
    
     NSString *newStr = [str stringByReplacingOccurrencesOfString:@"T" withString:@""];
    
    if (newStr.length > 10) {
        
        return [newStr substringFromIndex:10];
    }
    
    return @"";
    
}


-(BOOL)isNull{
    
    if ([self isEqual:[NSNull null]]) {
        
        return YES;
    }
    
    return NO;
}
@end
